<admintpl file="header" />
<style>
    .wrap{
        margin:10px;
    }
    .panel{
        display: none;
    }
</style>

</head>
<body>
<div class="wrap">
<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <!-- 返回信息 -->
            <div class="error-message" style="display:none;"></div>
            <form action="{:U('Admin/DataBase/import')}" method="post">
                <div>
                    <a href="{:U('Admin/DataBase/index')}" class="btn btn-info">去备份数据</a>
                </div>
                <div class="widget-box">
                    <div class="widget-header widget-header-flat">
                        <h4 class="smaller">
                            <i class="ace-icon glyphicon glyphicon-list"></i>
                            {$meta_title}
                        </h4>
                    </div>
                    <div class="widget-body">
                        <div class="widget-main">
                            <!-- 自定内容 -->
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th class="col-xs-4">备份名称</th>
                                    <th>文件总大小</th>
                                    <th>备份时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <volist name="backups" id="val">
                                    <tr class="collapsed">
                                        <td data="{$val.name}" class="flip">
                                            <a href="javascript:void(0);" style="text-decoration:none;">
                                                &nbsp;
                                                <i class="ace-icon glyphicon glyphicon-plus"></i>
                                            </a>&nbsp;{$val.name}
                                        </td>
                                        <td>{$val.total_size}kb</td>
                                        <td>{$val.date_str}</td>
                                        <td>
                                            <!-- <a href="{:U('Admin/DataBase/del_backup', array('backup'=>$val['name']))}" value="{$val['name']}" class="js-ajax-delete dleLink">删除备份</a> |  -->
                                            <a href="javascript:void(0);" value="{$val['name']}" class="js-ajax-delete dleLink">删除备份</a> |
                                            <!--<a href="{:U('Admin/DataBase/import', array('backup'=>$val['name']))}" class="js-ajax-dialog-btn" onclick="return confirm('确认要恢复吗？');">恢复</a>-->
                                        </td>
                                    </tr>
                                    <volist name="val['vols']" id="vol">
                                        <tr parent="{$val.name}" class="panel {$val.name}">
                                            <td>├─ {$vol.file}</td>
                                            <td>{$vol.size}kb</td>
                                            <td>{$val.date_str}</td>
                                            <td>
                                                 <!--<a href="{:U('Admin/DataBase/download', array('backup'=>$val['name'], 'file'=>$vol['file']))}">下载</a>-->
                                            </td>
                                        </tr>
                                    </volist>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </form>
            <!-- end -->
        </div>
    </div>
    <!-- /.row -->
</div>
</div>
</body>
<script type="text/javascript" src="__PUBLIC__/Common/js/jquery_asyncoper.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        // 隐藏、显示
        $(".flip").click(function(){
            var precent = $(this).attr('data');
            $("tr[parent='"+precent+"']").slideToggle("slow");
        });
    });
    //绑定删除的点击事件
    $(".dleLink").click(function () {
        var url="{:U('Admin/DataBase/del_backup')}";
        del(url,$(this));
    });
</script>
</html>